
import request from '@/utils/request'

const useStore = defineStore(
  'company',
  {
    state: () => ({
      // 列表
      list: []
    }),
    actions: {
        init() {
            request({
                url: '/company/listAll'
            }).then(res => {
                this.list = res;
            });
        },
      // 登录
      getList() {
        return this.list;
      },
      // 设置列表
      setList(list) {
          if (!list) {
              this.list = [];
              return;
          }
        this.list = list;
      },
    }
  })

export default useStore
